# 调查
# 编写一个while 循环，询问用户为何喜欢编程。每当用户输入一个原因后，都将其添加到一个存储所有原因的文件中

with open('programming_reasons.txt', 'a') as file_object:
    while True:
        reason = input("Why do you love programming(quit to exit)? ")
        if reason == 'quit':
            break
        file_object.write(f"{reason}\n")
